package com.zbec.mdrs.entity.history;


import com.zbec.framework.core.entity.IdEntity;
import com.zbec.mdrs.entity.discount.Discount;
import com.zbec.mdrs.entity.drafts.Drafts;
import com.zbec.mdrs.entity.entrustedLoan.EntrustedLoan;
import com.zbec.mdrs.entity.guarantee.Guarantee;
import com.zbec.mdrs.entity.loan.Loan;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;


@Entity
@Table(name = "tb_history")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class History extends IdEntity implements Serializable {
    private Long recordNumber;
    private Date importDate;
    private String importBy;
    private String recordStatus;
    private String businessType;
    private String businessMonth;
    private Set<Loan> loanSet = new HashSet<Loan>(0);
    private Set<Drafts> draftsdSet = new HashSet<Drafts>(0);
    private Set<Guarantee> guaranteedSet = new HashSet<Guarantee>(0);
    private Set<Discount> discountSet = new HashSet<Discount>(0);
    private Set<EntrustedLoan> entrustedLoanSet = new HashSet<EntrustedLoan>(0);

    @OneToMany(fetch= FetchType.LAZY, mappedBy="history")
    public Set<EntrustedLoan> getEntrustedLoanSet() {
        return entrustedLoanSet;
    }

    public void setEntrustedLoanSet(Set<EntrustedLoan> entrustedLoanSet) {
        this.entrustedLoanSet = entrustedLoanSet;
    }

    @OneToMany(fetch= FetchType.LAZY, mappedBy="history")
    public Set<Loan> getLoanSet() {
        return loanSet;
    }

    public void setLoanSet(Set<Loan> loanSet) {
        this.loanSet = loanSet;
    }

    @OneToMany(fetch= FetchType.LAZY, mappedBy="history")
    public Set<Drafts> getDraftsdSet() {
        return draftsdSet;
    }

    public void setDraftsdSet(Set<Drafts> draftsdSet) {
        this.draftsdSet = draftsdSet;
    }

    @OneToMany(fetch= FetchType.LAZY, mappedBy="history")
    public Set<Guarantee> getGuaranteedSet() {
        return guaranteedSet;
    }

    public void setGuaranteedSet(Set<Guarantee> guaranteedSet) {
        this.guaranteedSet = guaranteedSet;
    }

    @OneToMany(fetch= FetchType.LAZY, mappedBy="history")
    public Set<Discount> getDiscountSet() {
        return discountSet;
    }

    public void setDiscountSet(Set<Discount> discountSet) {
        this.discountSet = discountSet;
    }

    public Long getRecordNumber() {
        return recordNumber;
    }

    public void setRecordNumber(Long recordNumber) {
        this.recordNumber = recordNumber;
    }

    public Date getImportDate() {
        return importDate;
    }

    public void setImportDate(Date importDate) {
        this.importDate = importDate;
    }

    public String getImportBy() {
        return importBy;
    }

    public void setImportBy(String importBy) {
        this.importBy = importBy;
    }

    public String getRecordStatus() {
        return recordStatus;
    }

    public void setRecordStatus(String recordStatus) {
        this.recordStatus = recordStatus;
    }

    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    public String getBusinessMonth() {
        return businessMonth;
    }

    public void setBusinessMonth(String businessMonth) {
        this.businessMonth = businessMonth;
    }
}
